package FirstSecond;

public class DaemonDemo {
	public static class DaemonT extends Thread {
		public void run() {
			while(true) {
				System.out.println("I am alive");
				try {
					Thread.sleep(2000);
				} catch (InterruptedException ex) {
					ex.printStackTrace();
				}
			}
		}
	}
	
	public static void main(String[] args) throws Exception {
		Thread t = new DaemonT();

		t.setDaemon(true);
		t.start();

		Thread.sleep(2000);
	}
}
